# coding:utf-8
import requests
import requests
import json
url = "http://172.16.1.188:8080/api/manage_member/user/auth/login" # 接口地址

payload = {'password': '123456789','username': 'admin','uuid': '','verifyCode': '',}
r = requests.post(url, json=payload, verify=False)
token = json.loads(r.text)["token"] #获取登录后的token
print(token)
# admin增加运营管理
urlcy ="http://172.16.1.21/xl-dcs/api/manage/user/uniccc_user"

data={
	"userId": "",
	"username": "adminzizhanghaoguanliy",   # *账号
	"password": "111111111",                      #* 密码
	"department": "超级管理员管理管理添加部门添加部门",  # 部门
	"departmentList": [],
	"jobId": ["12"],
	"name": "张志超成员的真实姓名",  #*真实姓名
	"employeeId": "yuangongbianhao0000000001",  #职工编号
	"jobName": "",
	"mobilePhone": "18612320124",  #*手机号
	"email": "1232012418612320124@163.com", #*邮箱
	"macAdress": [],
	"userRemark": "管理员子账号备注信息管理员子账号备注信息管理员子账号备注信息管理员子账号备注信息管理员子账号备注信息管理员子账号备注信息管理员子账号备注信息管理员子账号备注信息",
	"operationUser": "",
	"operationTime": "",
	"parentId": "",
	"isDelete": "false"
}

data1=json.dumps(data)
headers = {"Accept"	:"application/json, text/plain, */*",
"Accept-Encoding"	:"gzip, deflate",
"Accept-Language"	:"zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
"Authorization"	: token,
"Connection"	:"keep-alive",
"Content-Length"	:"561",
"Content-Type"	:"application/json",
"Host"	:"172.16.1.21",
"Referer"	:"http://172.16.1.21/loginTo/adminiStration/adminiStration",
"User-Agent"	:"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36"}

r2 = requests.post(url=urlcy, data=data1, headers=headers)
print(r2.status_code)
print(r2.text)
print(data1)
